/**
 * Created by Administrator on 2016/5/26.
 */
$(function(){
    var url_true=$('#true-url').val();
    var url_false=$('#false-url').val();
    var app={
        true:function(obj){
            var loading=layer.load(1);
            $.post(
                url_true,
                {u_id:obj.attr('data-id-true')},
                function(res){
                    layer.close(loading);
                    if(res.status==1){
                        layer.msg(res.info,{icon:1});
                        window.location.reload();
                    }else{
                        layer.msg(res.info,{icon:2});
                        window.location.reload();
                    }
                });
        },

        false:function(obj){
            var loading=layer.load(1);
            $.post(
                url_false,
                {u_id:obj.attr('data-id-false')},
                function(res){
                    layer.close(loading);
                    if(res.status==1){
                        layer.msg(res.info,{icon:1});
                        window.location.reload();
                    }else{
                        layer.msg(res.info,{icon:2});
                        window.location.reload();
                    }
                });
        },
    }
    $('.true').click(function () {
        app.true($(this));
    });
    $('.false').click(function () {
        app.false($(this));
    });
});
